<?php
/**
 * Category action controller
 * 
 * @author paq
 *
 */
class Controller_Category extends Controller_Action
{
	public function __construct(Controller_Front $frontController)
	{
		parent::__construct('category', $frontController);
	}
		
	public function indexAction()
	{		
		if (isset($_GET['id_category'])) {
			$criteria = new Criteria();
			$criteria->add(NewsPeer::ID_CATEGORY, $_GET['id_category'], Criteria::EQUAL);
			$news = NewsPeer::doSelect($criteria);
			$this->view()->assign('news', $news);
			$this->view()->display('news.tpl');	
		} else {
			// show all news?
		}
	}
}